From 3594288ad0964f30795d4449cbdbd2241eb21fb9 Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Fri, 20 Jan 2023 02:21:32 +0100
Subject: [PATCH] fix integer overflows in tests

---
 tests/parser/assignment.c-expected | 1 +
 tests/parser/assignment.vala       | 1 +
 tests/structs/bug777194.c-expected | 6 +++---
 tests/structs/bug777194.vala       | 6 +++---
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/tests/parser/assignment.c-expected b/tests/parser/assignment.c-expected
index 64aa5c6..1f0d525 100644
--- a/tests/parser/assignment.c-expected
+++ b/tests/parser/assignment.c-expected
@@ -19,6 +19,7 @@ _vala_main (void)
 	i ^= 1;
 	i %= 1;
 	i = ~1;
+	i =  1;
 	i <<= 2;
 	i >>= 2;
 }
diff --git a/tests/parser/assignment.vala b/tests/parser/assignment.vala
index 257cd55..1144ed1 100644
--- a/tests/parser/assignment.vala
+++ b/tests/parser/assignment.vala
@@ -10,6 +10,7 @@ void main () {
 	i ^= 1;
 	i %= 1;
 	i = ~1;
+	i =  1;
 	i <<= 2;
 	i >>= 2;
 }
diff --git a/tests/structs/bug777194.c-expected b/tests/structs/bug777194.c-expected
index 055c37c..1986d6d 100644
--- a/tests/structs/bug777194.c-expected
+++ b/tests/structs/bug777194.c-expected
@@ -95,7 +95,7 @@ bar (guint8* a,
 	f_length1 = (a_length1 * sizeof (guint8)) / sizeof (Foo);
 	_f_size_ = f_length1;
 	_tmp0_ = f[0];
-	_vala_assert (_tmp0_.foo == (2LL << 62), "f[0].foo == 2LL << 62");
+	_vala_assert (_tmp0_.foo == (2LL << 61), "f[0].foo == 2LL << 61");
 	_tmp1_ = f[0];
 	_vala_assert (_tmp1_.bar == (2LL << 31), "f[0].bar == 2LL << 31");
 }
@@ -221,10 +221,10 @@ _vala_main (void)
 	gint _tmp27__length1;
 	guint8* _tmp28_;
 	gint _tmp28__length1;
-	_tmp0_.foo = 2LL << 62;
+	_tmp0_.foo = 2LL << 61;
 	_tmp0_.bar = 2LL << 31;
 	fstack = _tmp0_;
-	_tmp1_.foo = 2LL << 62;
+	_tmp1_.foo = 2LL << 61;
 	_tmp1_.bar = 2LL << 31;
 	_tmp2_ = _foo_dup0 (&_tmp1_);
 	fheap = _tmp2_;
diff --git a/tests/structs/bug777194.vala b/tests/structs/bug777194.vala
index def402e..15c518f 100644
--- a/tests/structs/bug777194.vala
+++ b/tests/structs/bug777194.vala
@@ -5,7 +5,7 @@ struct Foo {
 
 void bar (uint8[] a) {
 	unowned Foo[] f = (Foo[]) a;
-	assert (f[0].foo == 2LL << 62);
+	assert (f[0].foo == 2LL << 61);
 	assert (f[0].bar == 2LL << 31);
 }
 
@@ -13,8 +13,8 @@ void main () {
 	unowned uint8[] tu;
 	uint8[] to;
 
-	Foo fstack = { 2LL << 62 , 2LL << 31};
-	Foo? fheap = { 2LL << 62 , 2LL << 31};
+	Foo fstack = { 2LL << 61 , 2LL << 31};
+	Foo? fheap = { 2LL << 61 , 2LL << 31};
 
 	bar ((uint8[]) &fstack);
 	tu = (uint8[]) &fstack;
-- 
2.39.0
